package com.lsu.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lsu.app.bean.Kind;
import com.lsu.app.service.KindService;
import com.lsu.app.mapper.KindMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 *
 * @description 针对表【kind(课程类型表)】的数据库操作Service实现
 * @Date 2023-11-03 12:52:08
 * @author hjj
 */
@Service
public class KindServiceImpl extends ServiceImpl<KindMapper, Kind> implements KindService{
    private  final KindMapper mapper;

    public KindServiceImpl(KindMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public String[] getValueByCourseId(Integer courseId) {
        List<String> list = mapper.getValueByCourseId(courseId);
        String[] values = new String[list.size()];
        for(int i=0;i< list.size();i++){
            values[i]=list.get(i);
        }
        return values;
    }

    @Override
    public List<String> getAllKindValue() {
        return mapper.getAllKindValue();
    }

    @Override
    public List<Integer> getCourseIdsByKindName(String kindName) {
        return mapper.getCourseIdsByKindName(kindName);
    }

    @Override
    public List<Integer> getKindIdsByCourseId(Integer id) {
        return mapper.getKindIdsByCourseId(id);
    }


    @Override
    public void insertTasteKind(Integer tasteId, Integer kindId) {
        mapper.insertTasteKind(tasteId, kindId);
    }

    @Override
    public void insertBatchByALL(Integer type, Integer value, String name) {
        mapper.insertBatchByALL(type, value, name);
    }

}




